package com.stox.charting.ui.swing.model.unit;

public class BollingerUnit implements Comparable<BollingerUnit>{

	private double previousUpperBandValue;
	private double previousLowerBandValue;
	private double upperBandValue;
	private double lowerBandValue;
	
	public BollingerUnit() {
		
	}
	
	public BollingerUnit(double previousUpperBandValue,
			double previousLowerBandValue, double upperBandValue,
			double lowerBandValue) {
		super();
		this.previousUpperBandValue = previousUpperBandValue;
		this.previousLowerBandValue = previousLowerBandValue;
		this.upperBandValue = upperBandValue;
		this.lowerBandValue = lowerBandValue;
	}

	@Override
	public int compareTo(BollingerUnit o) {
		return 0;
	}
	
	public double getPreviousUpperBandValue() {
		return previousUpperBandValue;
	}
	public void setPreviousUpperBandValue(double previousUpperBandValue) {
		this.previousUpperBandValue = previousUpperBandValue;
	}
	public double getPreviousLowerBandValue() {
		return previousLowerBandValue;
	}
	public void setPreviousLowerBandValue(double previousLowerBandValue) {
		this.previousLowerBandValue = previousLowerBandValue;
	}
	public double getUpperBandValue() {
		return upperBandValue;
	}
	public void setUpperBandValue(double upperBandValue) {
		this.upperBandValue = upperBandValue;
	}
	public double getLowerBandValue() {
		return lowerBandValue;
	}
	public void setLowerBandValue(double lowerBandValue) {
		this.lowerBandValue = lowerBandValue;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(lowerBandValue);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(previousLowerBandValue);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(previousUpperBandValue);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(upperBandValue);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BollingerUnit other = (BollingerUnit) obj;
		if (Double.doubleToLongBits(lowerBandValue) != Double
				.doubleToLongBits(other.lowerBandValue))
			return false;
		if (Double.doubleToLongBits(previousLowerBandValue) != Double
				.doubleToLongBits(other.previousLowerBandValue))
			return false;
		if (Double.doubleToLongBits(previousUpperBandValue) != Double
				.doubleToLongBits(other.previousUpperBandValue))
			return false;
		if (Double.doubleToLongBits(upperBandValue) != Double
				.doubleToLongBits(other.upperBandValue))
			return false;
		return true;
	}
	
}
